<!--
 * @Author: 千锋爱佛僧
 * @公众号: 大前端私房菜
 * @Slogan: 千锋精品教程，好学得不像实力派！
-->
<!--
 * @Author: 千锋爱佛僧
 * @公众号: 大前端私房菜
 * @Slogan: 千锋精品教程，好学得不像实力派！
-->
<template>
  <div class="flex items-center p-30">
    <img class="mr-6 rounded-1 w-40" src="../assets/img/avatar1.png" alt="" />
    <div>
      <h2>三丰</h2>
      <van-button type="warning" plain size="small" to="/edit"
        >编辑资料</van-button
      >
    </div>
  </div>
  <van-cell-group>
    <van-cell title="我的收藏" is-link v-for="_ in 6"></van-cell>
  </van-cell-group>
  <div class="p-20">
    <van-button type="danger" block @click="handleLogout">退出登录</van-button>
  </div>
</template>

<script setup lang="ts">
import { useRouter } from "vue-router";
import { useAccount } from "../store/user";
const user = useAccount();
const router = useRouter();
const handleLogout = () => {
  user.userInfo = null;
  router.push("/");
};
</script>

<style scoped></style>
